package com.lzy.mall.common.exception;

/**
 * @author lzy
 * @date 2021/9/25 11:20
 */
public enum CommonError implements IErrorCode {
    USER_NOT_LOGIN(501, "需要登录"),
    TOKEN_EXPIRED(402, "登录信息已过期，请重新登录"),
    REGISTERED_ERROR(-101, "注册失败"),
    LOGIN_ERROR(400, "登录失败"),
    ACCOUNTNO_ISNULL(-100, "账号不能为空"),
    ACCOUNTNO_ERROR(-100, "账号错误"),
    USERPASSWORD_ISNULL(-100, "密码不能为空"),
    USERPASSWORD_ERROR(-100,"密码错误"),
    PHONE_ERROR(-100, "请输入有效号码"),
    INVALID_PHONE_ERROR(404, "手机号未注册"),
    ACCOUNT_ISSINGIN(-100, "该账号已注册"),
    PHONE_ISSINGIN(-100, "该手机号已注册"),
    ACCOUNT_OR_PHONE_ISSINGIN(-100, "手机号或用户名已注册"),
    PHONE_OR_IDNUMBER_ISSINGIN(-100, "该手机号和该身份证已注册"),
    CODE_ERROR(-100, "验证码错误"),
    MSG_WAITTING(-101, "短信已发送，请60秒后重试"),
    VALIDATECODE_ERROR(-101,"验证码错误"),
    BIND_ARGS_ERROR(600, "必须填空项不能为空"),
    IDNUMBER_ERROR(-100,"请输入正确的身份证号"),
    NOT_STOCK_EXCEPTION(21000, "商品库存不足")
    ;


    private Integer code;
    private String msg;

    CommonError() {
    }

    CommonError(Integer code, String msg) {
        this.code = code;
        this.msg = msg;
    }

    public Integer getCode() {
        return code;
    }

    public void setCode(Integer code) {
        this.code = code;
    }

    public String getMsg() {
        return msg;
    }

    public void setMsg(String msg) {
        this.msg = msg;
    }
}
